-
Notifications
You must be signed in to change notification settings - Fork 10.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FIX] SlackBridge private channels #13261
Conversation
|
4efa23a
to
1a960aa
Compare
|
||
slackResults = HTTP.get('https://slack.com/api/conversations.info', { params: { token: this.slackBridge.apiToken, channel: slackChannelID } }); | ||
if (slackResults && slackResults.data && slackResults.data.ok === true) { | ||
slackMembers = HTTP.get('https://slack.com/api/conversations.members', { params: { token: this.slackBridge.apiToken, channel: slackChannelID } }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to the documentation about this endpoint, when the "limit" parameter is not provided, the default limit is 100 items. How are you dealing with it, if the channel has more than 100 members?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MarcosSpessatto this is a good point. It looks like the previous limitation was 1500 members rather than 100 members:
The documentation at https://api.slack.com/methods/conversations.members does not state a hard limit, but recommends using a page size of 200. A for
loop using the limit
and cursor
parameters should be sufficient to make this work for any number of members.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MarcosSpessatto I do not have a test installation that would be appropriate to resolve this, and it's unlikely that I'll have time to look at it further. Please feel free to update this PR.
Oddly enough, I'm able to replicate this bug. I have a private channel in Slack with a channel ID that starts with "C" and the sync silently fails between Slack and Rocket. I thought it was a failure of Private channels in general, but it does seem specific to channels with IDs that happen to start with "C". |
… into fix/slackbridge-private-channels
Closes #13186
Closes #9408
Closes #11356
Closes #11485
Closes #7539
Closes #10002
Changed groups.info deprecated endpoint to conversations.info.
Changed to the new endpoint to get the members of room conversations.members.
Removed the deprecated message event file_share.
I think we can close #12213 in favor of this one.
We have a channel in our Slack group that was breaking the SlackBridge:
This is a private channel, but its ID starts with
C
. This would already break the existing code if everything else worked, because the channel would be created as public in Rocket.Chat.If that weren't enough of a problem, neither the
channels.info
nor thegroups.info
Slack API methods work with this channel:What does work is
conversations.info
. This doesn't have thechannel.members
key though, so we can get that with a separate call toconversations.members
.All other data elements needed by this area of the code are present in the
conversations.info
response as expected.